package com.xinyi.share.weixin;

/**
 * token实体
 * 
 * @author Administrator
 *
 */
public class AccessTokenEntity {
	private String accesstoken;
	private long expiresin;
	private long currenttimes;

	public AccessTokenEntity() {
		super();
	}

	public String getAccesstoken() {
		return accesstoken;
	}

	public void setAccesstoken(String accesstoken) {
		this.accesstoken = accesstoken;
	}

	public void setCurrenttimes(long currenttimes) {
		this.currenttimes = currenttimes;
	}

	public void setExpiresin(long expiresin) {
		this.expiresin = expiresin;
	}

	/**
	 * 判断token是否在有效时间内，true是，false不是
	 * 
	 * @param currenttimes
	 * @return
	 */
	public boolean isEffective(long currenttimes) {
		if ((currenttimes - this.currenttimes + 600000) > expiresin) {
			return false;
		}
		return true;
	}
}
